# -*- coding: utf-8 -*-
from distutils.core import setup
from distutils.extension import Extension

# ModuleFinder can't handle runtime changes to __path__, but win32com uses them
try:
	# py2exe 0.6.4 introduced a replacement modulefinder.
	# This means we have to add package paths there, not to the built-in
	# one.	If this new modulefinder gets integrated into Python, then
	# we might be able to revert this some day.
	# if this doesn't work, try import modulefinder
	try:
		import py2exe.mf as modulefinder
	except ImportError:
		import modulefinder
	import win32com, sys
	for p in win32com.__path__[1:]:
		modulefinder.AddPackagePath("win32com", p)
	for extra in ["win32com.shell"]: #,"win32com.mapi"
		__import__(extra)
		m = sys.modules[extra]
		for p in m.__path__[1:]:
			modulefinder.AddPackagePath(extra, p)
except ImportError:
	# no build path setup, no worries.
	pass

from distutils.core import setup
# from Cython.Distutils import build_ext
import py2exe

options = {
    "bundle_files": 2,
    "ascii": 1, # to make a smaller executable, don't include the encodings
    "compressed": True, # compress the library archive
    "excludes": ['w9xpopen.exe',],
	'dll_excludes': [ "mswsock.dll", "powrprof.dll" ]
    }

# ext_modules = [Extension("BoxBlur", ["BoxBlur.pyx"])]
ext_modules = []

setup( # console = ['pyWallpaper.py'],
	windows = ['pyWallpaper.py'],
	options = {'py2exe': options},
	name = 'BoxBlur Function',
#	cmdclass = {'build_ext': build_ext},
	ext_modules = ext_modules,
	zipfile = None
	)
